#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 修改有返回值的类型
import json


class  Diff():
    def __init__(self):
        self.d = 0  # 判断是否有不一样的 这里定义的是全局的
        self.resa=''
        self.resb=''

    def diff(self,j1, j2):
        if isinstance(j1, dict) and isinstance(j2, dict):
            for key in j1.keys():
                if key not in j2:
                    pass

                else:
                    if key == 'uuid' or  key =='ImgUrl' or  key =='timestamp'or  key =='realTime'or  key =='proImg' \
                            or  key =='time' or  key =='updateTime' or key == 'TIME_STAMP' or key == 'ELAPSED_TIME':
                        continue
                    j1[key], j2[key]= self.diff(j1[key], j2[key])

        elif isinstance(j1, (tuple, list)) and isinstance(j2, (tuple, list)):
            if len(j1) != len(j2): # 直接不相等是直接涂
                j1="ThisIdYellowBegin" + str(j1) + "ThisIdYellowEnd"
                j2="ThisIdYellowBegin" + str(j2) + "ThisIdYellowEnd"
                self.d = 1
                return  j1,j2
            else:
                for i in range(0, len(j1)):
                    j1[i], j2[i] = self.diff(j1[i], j2[i])
        elif (isinstance(j1, (int, float)) and isinstance(j2, (int, float))):
            if (abs(j1 - j2) < 0.000001 or str(j1) == str(j2)):
                return j1,j2
            else:
                j1="ThisIdYellowBegin" + str(j1) + "ThisIdYellowEnd"
                j2="ThisIdYellowBegin" + str(j2) + "ThisIdYellowEnd"
                self.d =1
                return j1, j2

        else:
            if (str(j1).find('img10.360buyimg.com')>=0 and str(j2).find('img10.360buyimg.com')>=0) or (str(j1).find('item.jd.com')>=0 and str(j2).find('item.jd.com')>=0):
                return j1, j2
            elif j1 != j2:
                if j1[0] in ['{' ,'[']:
                    #  若是"{}"和 "[{}]"形式的字符串需特殊处理
                    try:
                        j1 = json.loads(j1)  # 这里一次就好
                        j2 = json.loads(j2)
                        j1, j2 = self.diff(j1, j2)
                    except Exception as e:
                        pass
                else:
                    j1="ThisIdYellowBegin" + j1 + "ThisIdYellowEnd"
                    j2="ThisIdYellowBegin" + j2 + "ThisIdYellowEnd"
                    self.d = 1
                    return j1, j2
            else:
                return j1, j2
        self.resa=j1
        self.resb=j2
        return j1, j2

    def  result(self):
        if self.d:
            return True,self.resa,self.resb
        else:
            return False,self.resa,self.resb

if __name__=='__main__':
    # '{"department_5":"4339"}' 这中格式有问题呢,如果有不一致的没有标黄
    # app1={'cur_filter': {"department_5":"abc"}}
    # app2={'cur_filter': {"department_5":"abcd"}}
    # app1={'cur_filter': {"department_5":123}}
    # app2={'cur_filter': {"department_5":1234}}
    app1={'cur_filter': '[{"department_5":"4339","department_6":"433999"}]'}
    app2={'cur_filter': '[{"department_6":"43399","department_5":"4339"}]'}
    #app1={'cur_filter': '{"department_5":"3649"}'}
    #app2={'cur_filter': '{"department_5":"3648"}'}
    app11 ={'status': 1, 'time_msg': '', 'err_msg': '', 'SYSTEM_DEBUG': {'ELAPSED_TIME': 329.66186523438, 'TIME_STAMP': 1615258985}, 'data': {'cur_categorys': 'department_1,department,department_3,department_4,department_5,department_erp,brand', 'next_category_list': [{'name': '平台', 'is_no_avg': 1, 'key': 'department_1,department,department_3,department_4,department_5,department_erp,brand,platform'}], 'unit': '万', 'list': [{'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '10.5'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}], 'is_bottom': 1, 'name': '汇总', 'key': 'summary'}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"7046"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '5.03'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '芙丽芳丝（Freeplus）', 'key': 7046}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"80044"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '3.94'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '珂润（Curel）', 'key': 80044}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"8464"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '1.07'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '花印（HANAJIRUSHI）', 'key': 8464}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"627939"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.213'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '皑丽（ALLIE）', 'key': 627939}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"182432"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.177'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'DR.G', 'key': 182432}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"164911"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.145'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'Loshi', 'key': 164911}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"104557"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.142'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '蜜浓（MINON）', 'key': 104557}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"161221"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.139'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '怡思丁（ISDIN）', 'key': 161221}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"71302"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0462'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '柳屋', 'key': 71302}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"168669"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0069'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'ABOUT ME', 'key': 168669}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"4609"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0045'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '贝佳斯（Borghese）', 'key': 4609}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"14261"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0021'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '千妇恋（CHIFURE）', 'key': 14261}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"283614"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0014'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'repavar', 'key': 283614}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"118826"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0004'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '杜碧丝（Dimples）', 'key': 118826}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"395490"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0004'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '妮珍', 'key': 395490}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"471127"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0003'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '好优可（NICE QUICK）', 'key': 471127}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"7293"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0003'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '高丽雅娜（Coreana）', 'key': 7293}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"260989"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0001'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '玥之秘', 'key': 260989}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"442604"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0001'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '怡婷美', 'key': 442604}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"526982"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0001'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'KOSMEA', 'key': 526982}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"197964"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0001'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'Elta MD', 'key': 197964}]}}
    app22 ={'status': 1, 'time_msg': '', 'err_msg': '', 'SYSTEM_DEBUG': {'ELAPSED_TIME': 234.65380859375, 'TIME_STAMP': 1615258986}, 'data': {'cur_categorys': 'department_1,department,department_3,department_4,department_5,department_erp,brand', 'next_category_list': [{'name': '平台', 'is_no_avg': 1, 'key': 'department_1,department,department_3,department_4,department_5,department_erp,brand,platform'}], 'unit': '万', 'list': [{'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_erp":"bjhjinj","department_1":"1726","department":"2785","department_3":"3626","department_4":"3647\',\'4338","department_5":"3648\',\'4339"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '10.5'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}], 'is_bottom': 1, 'name': '汇总', 'key': 'summary'}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"7046"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '5.03'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '芙丽芳丝（Freeplus）', 'key': 7046}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"80044"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '3.94'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '珂润（Curel）', 'key': 80044}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"8464"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '1.07'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '花印（HANAJIRUSHI）', 'key': 8464}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"627939"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.213'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '皑丽（ALLIE）', 'key': 627939}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"182432"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.177'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'DR.G', 'key': 182432}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"164911"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.145'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'Loshi', 'key': 164911}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"104557"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.142'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '蜜浓（MINON）', 'key': 104557}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"161221"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.139'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '怡思丁（ISDIN）', 'key': 161221}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"71302"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0462'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '柳屋', 'key': 71302}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"168669"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0069'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'ABOUT ME', 'key': 168669}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"4609"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0045'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '贝佳斯（Borghese）', 'key': 4609}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"14261"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0021'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '千妇恋（CHIFURE）', 'key': 14261}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"283614"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0014'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'repavar', 'key': 283614}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"118826"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0004'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '杜碧丝（Dimples）', 'key': 118826}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"395490"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0004'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '妮珍', 'key': 395490}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"471127"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0003'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '好优可（NICE QUICK）', 'key': 471127}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"7293"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0003'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '高丽雅娜（Coreana）', 'key': 7293}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"260989"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0001'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '玥之秘', 'key': 260989}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"442604"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0001'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': '怡婷美', 'key': 442604}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"3647","department_5":"3648","department_erp":"bjhjinj","brand":"526982"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0001'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'KOSMEA', 'key': 526982}, {'graph_tab': [{'name': '十分', 'key': 'slot'}, {'name': '小时', 'key': 'hour'}], 'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj","brand":"197964"}]', 'rows': [{'base_plant': 'global', 'c_name': '胡金晶', 'pre_year_data': '-', 'pre_year_uptick': '-', 'today': '0.0001'}], 'cur_index': 'detail_uv', 'operation_tab': [{'name': '邮件推送指标', 'key': 'send_email', 'is_fold': '1'}, {'name': '指标概览', 'key': 'index_list', 'is_fold': '1'}], 'is_bottom': 0, 'name': 'Elta MD', 'key': 197964}]}}
    # app3 = {'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"3648\',\'4339","department_erp":"bjhjinj"}]'}
    # app4 = {'cur_filter': '[{"department_1":"1726","department":"2785","department_3":"3626","department_4":"4338","department_5":"4339","department_erp":"bjhjinj"}]'}
    # app1 = {'test':'abc'}
    # app2 = {'test':'abcd'}
    dif=Diff()
    dif.diff(app11,app22)
    # app3=json.dumps(app11)
    # print(app3)
    # app4=json.dumps(app22)
    # print(app4)
    result_diff = dif.result()
    print(result_diff)
